import * as charts from 'echarts';
import ReactEcharts from 'echarts-for-react';



type EChartsOption = charts.EChartsOption;

const getOption = () => {
  const option: EChartsOption = {
    title: {
      text: '每周用户访问指标',
    },
    tooltip: {},
    legend: {
      data: ['评论数', '访问量'],
    },
    xAxis: {
      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
    },
    yAxis: {},
    series: [
      {
        name: '评论数',
        type: 'bar',
        data: [110, 200, 150, 90, 80, 110, 120],
        color: ['#c23631'],
      },
      {
        name: '访问量',
        type: 'line',
        data: [360, 290, 350, 110, 100, 120, 160],
        color: ['#304655'],
      },
    ],
  };
  return option;
};

export default function Echarts() {
  return (
    <div style={{ marginTop: '15px' }}>
      <ReactEcharts option={getOption()}></ReactEcharts>
    </div>
  );
}
